﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using System.Web;
using System.IO;
using System.Text.RegularExpressions;

namespace WindowsFormsApplication4
{
    public partial class Form1 : Form
    {
        Timer timer = new Timer();
        DateTime tiempoInicio = new DateTime();


        public Form1()
        {
            InitializeComponent();
           }
        
        void timer_Tick(object sender, EventArgs e)
        {
            int contador = DateTime.Now.Second - tiempoInicio.Second;

            if (contador != 3)
            {
                
                segundos.Text = contador.ToString();

            }
            else {
                segundos.Text = contador.ToString();
                mostrarMsje.Text = "Termine soy bkn";
                timer.Stop();
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            tiempoInicio = DateTime.Now;
            timer.Tick += new EventHandler(timer_Tick); // Everytime timer ticks, timer_Tick will be called
            timer.Interval = (1000) * (1);              // Timer will tick evert second
            timer.Enabled = true;                       // Enable the timer
            timer.Start();                              // Start the timer
        
        }

     

    }
}
